<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
 lang="en" dir="ltr">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" href="../codebase/default.css" type="text/css" media="screen" title="no title" charset="utf-8"><title>
    dhtmlxdataprocessor:data_sending_modes    [Skin test wiki]
  </title></head>

<body>
<div class="dokuwiki">
  
  <div class="stylehead">

    <div class="header">
    <a class="logo" href="http://dhtmlx.com" title="DHTMLX Documentation homepage"></a>
    <span class="tittle-dhtmlx">DHTMLX Docs & Samples Explorer</span>

    <div class="search-field">
        <form action="http://dhtmlx.com/dhxdocs/doku.php" accept-charset="utf-8" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" title="Search" /><button type="submit"></button><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>    </div>
        <div class="buttons">
                <a class="doc"></a>
                <a title="DHTMLX Samples homepage" href="../samples.html" class="sample"/></a>
        </div>
     <!-- <div class="pagename">
        [[<a href="#"  title="Backlinks">dhtmlxdataprocessor:data_sending_modes</a>]]
      </div>
      <div class="logo">
        <a href="/dhtmlx/_lab/wiki/doku.php"  name="dokuwiki__top" id="dokuwiki__top" accesskey="h" title="[H]">Skin test wiki</a>      </div>

      <div class="clearer"></div>-->
        
    </div>

    
<!--   <div class="bar" id="bar__top">
      <div class="bar-left" id="bar__topleft">
                <form class="button btn_revs" method="get" action="http://dhtmlx.com/dhxdocs/doku.php"><div class="no"><input type="hidden" name="do" value="revisions" /><input type="hidden" name="id" value="dhtmlxdataprocessor:data_sending_modes" /><input type="submit" value="Old revisions" class="button" accesskey="o" title="Old revisions [O]" /></div></form>      </div>

      <div class="bar-right" id="bar__topright">
        <form class="button btn_recent" method="get" action="http://dhtmlx.com/dhxdocs/doku.php"><div class="no"><input type="hidden" name="do" value="recent" /><input type="hidden" name="id" value="dhtmlxdataprocessor:data_sending_modes" /><input type="submit" value="Recent changes" class="button" accesskey="r" title="Recent changes [R]" /></div></form>        <form action="http://dhtmlx.com/dhxdocs/doku.php" accept-charset="utf-8" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" title="Search" /><button type="submit"></button><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>&nbsp;
      </div>

      <div class="clearer"></div>
    </div> -->

<!--        <div class="breadcrumbs">
      <span class="bchead">Trace:</span> <span class="bcsep">&raquo;</span> <span class="curid"><a href="/dhtmlx/_lab/wiki/doku.php?id=dhtmlxdataprocessor:data_sending_modes"  class="breadcrumbs" title="dhtmlxdataprocessor:data_sending_modes">data_sending_modes</a></span>    </div>
    -->

    
  </div>
  
  
  <div class="page">
    <!-- wikipage start -->
    
<p>
<div class='backlinks'><div class='backlink last_backlink'><img src="icons___file.gif"  class="media" alt="" /><a href="../index.html" class="wikilink1" title="start">Index</a></div><div class='arrow'></div><div class='backlink last_backlink'><img src="icons___dataprocessor.gif"  class="media" alt="" /><a href="index.html" class="wikilink1" title="dhtmlxdataprocessor:toc">dhtmlxdataprocessor</a></div><div class='arrow'></div><div class='backlink'><span class="curid"><a href="dhtmlxdataprocessor___data_sending_modes.html" class="wikilink1" title="dhtmlxdataprocessor:data_sending_modes"> Data Sending Modes </a></span></div></div>

</p>

<h2><a name="data_sending_modes" id="data_sending_modes">Data Sending Modes</a></h2>
<div class="level2">

<p>

a) Meaningfull names.<br/>
 
The parameters c0-cN, used by default, are not very useful on the server side. The dataprocessor allows to use the grid column IDs instead of them:

</p>
<pre class="code javascript">      grid.<a href='dhtmlxgrid___api_method_dhtmlxgridobject_setheader.html'><b><span class="me1">setHeader</span></b></a><span class="br0">&#40;</span><span class="st0">&quot;Name of the book,Name of the author&quot;</span><span class="br0">&#41;</span>
      grid.<a href='dhtmlxgrid___api_method_dhtmlxgridobject_setcolumnids.html'><b><span class="me1">setColumnIds</span></b></a><span class="br0">&#40;</span><span class="st0">&quot;book,author&quot;</span><span class="br0">&#41;</span>;
      ...
      <span class="me1">dp</span>.<span class="me1">enableDataNames</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span>;</pre>
<p>

on the server side:<br/>

$_GET[&#039;c0&#039;]     ⇒     $_GET[&#039;book&#039;]<br/>

$_GET[&#039;c1&#039;]     ⇒     $_GET[&#039;author&#039;]
</p>

<p>
b) Using POST instead of GET.<br/>


</p>
<pre class="code javascript">      dp.<span class="me1">setTransactionMode</span><span class="br0">&#40;</span><span class="st0">&quot;POST&quot;</span><span class="br0">&#41;</span></pre>
<p>

c) Sending all at once.<br/>

By default the update for each row will be sent as a separate request. This means that when 20 rows are updated - 20 requests will be sent to the server. This is not the best approach, so instead of it a single (more complex) request can be sent to the server side:

</p>
<pre class="code javascript">      dp.<span class="me1">setTransactionMode</span><span class="br0">&#40;</span><span class="st0">&quot;POST&quot;</span><span class="sy0">,</span><span class="kw2">true</span><span class="br0">&#41;</span></pre>
<p>

In such mode the server side receives a slightly different set of parameters:<br/>

ids - a comma separated list of updated rows IDs, for each ID there will be set of details in the request.
</p>

<p>
For example if we have two updated rows on the client side with IDs = r2 and  r3, the server side code will receive:<br/>

ids = r2,r3
</p>
<ul>
<li class="level1"><div class="li"> r2_!nativeeditor_status - the status of the operation for row r2;</div>
</li>
<li class="level1"><div class="li"> r2_c0 .. r2_cN - the data for a column of row r2;</div>
</li>
<li class="level1"><div class="li"> r3_!nativeeditor_status - the status of the operation for row r3;</div>
</li>
<li class="level1"><div class="li"> r3_c0 .. r3_cN - the data for a column of row r3.</div>
</li>
</ul>

<p>

The awaited server side response must be in the same format as usual, but must include the data for all processed rows:

</p>
<pre class="code javascript">      <span class="sy0">&lt;</span>data<span class="sy0">&gt;</span>
           <span class="sy0">&lt;</span>action type<span class="sy0">=</span><span class="st0">&quot;some&quot;</span> sid<span class="sy0">=</span><span class="st0">&quot;r2&quot;</span> tid<span class="sy0">=</span><span class="st0">&quot;r2&quot;</span> <span class="sy0">/&gt;</span>
           <span class="sy0">&lt;</span>action type<span class="sy0">=</span><span class="st0">&quot;some&quot;</span> sid<span class="sy0">=</span><span class="st0">&quot;r3&quot;</span> tid<span class="sy0">=</span><span class="st0">&quot;r3&quot;</span> <span class="sy0">/&gt;</span>
       <span class="sy0">&lt;/</span>data<span class="sy0">&gt;</span></pre>
<p>
d) User can enable mode when only changed fields and row id send to the server side, instead of all fields in default mode

</p>
<pre class="code javascript">      dp.<span class="me1">enablePartialDataSend</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span>;</pre>
<p>
e) Active fields.<br/>

There is possibility to define which column may trigger update:

</p>
<pre class="code javascript">      dp.<span class="me1">setDataColumns</span><span class="br0">&#40;</span><span class="br0">&#91;</span><span class="kw2">false</span><span class="sy0">,</span><span class="kw2">true</span><span class="sy0">,</span><span class="kw2">true</span><span class="sy0">,</span><span class="kw2">true</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;</pre>
<p>
In that case changing first column values will not trigger data sending to the server. Such mode have sense only if auto update is enabled.
</p>

</div>

    <!-- wikipage stop -->
  </div>

  <div class="clearer">&nbsp;</div>

  
  <div class="stylefoot">

    <div class="meta">
      <div class="user">
              </div>
     <!-- <div class="doc">
        dhtmlxdataprocessor/data_sending_modes.txt &middot; Last modified: 2009/09/23 18:49 (external edit)      </div>
    </div>-->

   
    <!--<div class="bar" id="bar__bottom">-->
      <!--<div class="bar-left" id="bar__bottomleft">-->
        <!---->
        <!--<form class="button btn_revs" method="get" action="http://dhtmlx.com/dhxdocs/doku.php"><div class="no"><input type="hidden" name="do" value="revisions" /><input type="hidden" name="id" value="dhtmlxdataprocessor:data_sending_modes" /><input type="submit" value="Old revisions" class="button" accesskey="o" title="Old revisions [O]" /></div></form>-->
      <!--</div>-->
      <!--<div class="bar-right" id="bar__bottomright">-->
        <!---->
        <!---->
        <!---->
        <!---->
        <!--<form class="button btn_login" method="get" action="http://dhtmlx.com/dhxdocs/doku.php"><div class="no"><input type="hidden" name="do" value="login" /><input type="hidden" name="sectok" value="0b8524191cbc03f5a3b3153a45aa5af0" /><input type="hidden" name="id" value="dhtmlxdataprocessor:data_sending_modes" /><input type="submit" value="Login" class="button" title="Login" /></div></form>-->
        <!--<form class="button btn_index" method="get" action="http://dhtmlx.com/dhxdocs/doku.php"><div class="no"><input type="hidden" name="do" value="index" /><input type="hidden" name="id" value="dhtmlxdataprocessor:data_sending_modes" /><input type="submit" value="Index" class="button" accesskey="x" title="Index [X]" /></div></form>-->
        <!--<a class="nolink" href="#dokuwiki__top"><input type="button" class="button" value="Back to top" onclick="window.scrollTo(0, 0)" title="Back to top" /></a>&nbsp;-->
      <!--</div>-->
      <!--<div class="clearer"></div>-->
    <!--</div>-->

  </div>

  

</div>

<div class="footerinc">


</div>

<div class="no"><img src="/dhtmlx/_lab/wiki/lib/exe/indexer.php?id=dhtmlxdataprocessor%3Adata_sending_modes&amp;1257951068" width="1" height="1" alt=""  /></div>
     <div class="footer">
        <div class="footer-logo"></div>
        <div class="copyright">Copyright © 1998-2009 DHTMLX LTD.<br />All rights reserved.</div>
            	    </div>
</body>
</html>
